﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Platform.Storage.Redis
{
	/// <summary>
	/// Representa uma linha da resposta do REDIS
	/// </summary>
	public class RedisReplyLine
	{
		public RedisReplyLine( string line )
		{
			if ( String.IsNullOrEmpty( line ) )
				this.Init( RedisReplyStatus.None, String.Empty, String.Empty );
			else
				this.Init( RedisUtility.GetReply( line ), line, line.Substring( 1 ) );
		}

		public RedisReplyLine( RedisReplyStatus reply, string lineAndMessage )
		{
			this.Init( reply, lineAndMessage, lineAndMessage );
		}

		private void Init( RedisReplyStatus reply, string line, string message )
		{
			this.Reply = reply;
			this.Line = line;
			this.Message = message;
		}


		public RedisReplyStatus Reply
		{ get; private set; }

		public string Line
		{ get; private set; }

		public string Message
		{ get; private set; }

	}
}
